package cloud.server2.service.impl;

import java.net.InetSocketAddress;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cloud.server2.netty.client.NettyClient;
import cloud.server2.service.HelloService2;
import lombok.extern.log4j.Log4j;

@Service
@Log4j
public class HelloService2Impl implements HelloService2 {

	public String hello() {
		return "Called HelloService2.hello()";
	}

	public String netty() {
		InetSocketAddress address = new InetSocketAddress("127.0.0.1", 877);
		NettyClient client2 = new NettyClient(address);
		try {
			client2.start();
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null;
	}
}
